import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// 点击保存
	const sub = fd.data.node.querySelector<HTMLTextAreaElement>('[data-id="risk_po_type_name"]').value;
	if (!sub) {
		alert('请将信息填写完整');
		return;
	}
	//风险等级
	const level = fd.data.node.querySelector<HTMLSelectElement>('[data-id="risk_level"]').value;
	if (level === "请选择风险等级") {
		alert('请将信息填写完整');
		return;
	}
	console.log('lev', level)
	// const d_name = get(fd, 'd_name');
	// const nos = get(fd, 'nos');
	const r = await nodejs<{ code: 0 | 1; }>('risk-point/zj-000009/s002', {
		filter: {
			risk_level: level,
			risk_po_type_name: sub,
		}
	});
	console.log(r);
	if (r.code === 1) {
		alert("保存成功");
		refresh();
	} else {
		alert("保存失败");
	}

}
